import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/signup',
      name: 'signup',
      component: () => import(/* webpackChunkName: "about" */ './views/SignUp.vue')
    },
    {
      path: '/user',
      name: 'user',
      component: () => import(/* webpackChunkName: "about" */ './views/IndexUser.vue'),
      children: [
        {
          path : '/user',
          redirect: 'tasklist'
        },
        {
          path: 'tasklist',
          name: 'tasklist',
          // component: () => import('./views/Recommend.vue')
          component: resolve => require(["./views/TaskList.vue"], resolve)
        },
        {
          path: 'userlist',
          name: 'userlist',
          // component: () => import('./views/Hotlist.vue')
          component: resolve => require(["./views/UserList.vue"], resolve)
        }
      ]
    },
    {
      path: '/admin',
      name: 'admin',
      component: () => import(/* webpackChunkName: "about" */ './views/IndexAdmin.vue')
    },
    {
      path: '/superadmin',
      name: 'superadmin',
      component: () => import(/* webpackChunkName: "about" */ './views/IndexSuperAdmin.vue')
    },
    {
      path: '/edit/:id',
      name: 'edit',
      component: () => import('./views/Edit.vue')
    },
  ]
})
